Repository navigation
Add IMX519 driver and device tree overlay - #4548
Conversation
|
Initial comments before I start reviewing the driver. A couple of checkpatch warnings (I do have --strict enabled by default) Device tree bindings should always be in a separate patch from the driver - they are handled via different trees in mainline, and DT can describe things about the hardware that the driver doesn't support. Is there anything different about your version of the module to the standard Sony one? If not then it should use Sony's vendor prefix and not an Arducam one. As discussed by email, VCM control is supported by the framework by using a |
6by9
left a comment
There was a problem hiding this comment.
A number of these look to be due to copying IMX477 but not supporting some of the features. This leaves a number of chunks of effectively dead code around.
|
|
||
| #define IMX519_XCLK_FREQ 24000000 | ||
|
|
||
| #define IMX519_DEFAULT_LINK_FREQ 648000000 |
There was a problem hiding this comment.
Minor note that if this is actually correct, then it exceeds the spec for CSI-2 which is 1Gbit/s/lane, which equates to 500MHz as it is DDR.
Unicam (the CSI-2 receiver) does normally cope with slightly higher data rates, but technically you're exceeding the spec.
There was a problem hiding this comment.
This should be my calculation error.
The actual frequency was 525Mhz before, but it has been reduced to 493.5Mhz.
|
For mainline, patches need to have a named author - https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin Also MAINTAINERS hasn't been updated to report who is maintaining the DT binding and driver files. |
|
Hi 6by9 Thank you for your review and suggestions, We will resolve your proposed amendments as soon as possible. Regarding the VCM driver, since the current framework is still a bit imperfect, we plan to use this temporary solution. Is this acceptable? |
Which part of the framework do you have an issue with? Yes the control will be under a different subdev node, but that's how it will end up being anyway. |
|
When the camera is turned on again, it will write the last control value: linux/drivers/media/i2c/imx477.c Line 1715 in e4cb65c But at present, when the camera is turned on, other subdevs are not notified, which makes it impossible to restore the control value of VCM. is it right? Maybe I missed something? |
As per my comment
Both the lens driver and sensor drivers need to make a request to the regulator driver for the sensor/lens to be powered on when required. The regulator driver will reference count the requests, and only power down when neither want it. There is a need to be careful that a regulator request to power down and up does not necessarily result in an actual reset if there are other users of the regulator. Most sensors use the software reset at the start of their initialisation sequence anyway, so that's not normally an issue. |
I understand. I noticed that regulator_register_notifier may achieve my purpose, but I am not sure whether this is the correct usage. |
e3a8e16 to
0002a4e
Compare
0002a4e to
e4cb65c
Compare
Not sure if the link in MAINTAINERS is correct... |
|
I'm happy with this PR from an overlay, Kconfig, Makefile and commit partitioning perspective - I'll leave the driver reviewing to @6by9. The pachyderm in the parlour is that we expect non-Pi-specific drivers to be submitted upstream - we can't commit to supporting them ourselves indefinitely. What are your plans for upstreaming? |
|
Hi pelwell, I’m not sure about the workflow here, |
OK, so it's effectively the "default" case where the sensor is being used and the lens not being cared about by a particular app, so it needs to be restored when the sensor is powered up. In which case I believe you are correct that Using
I was offering to do a first pass review on the driver before it was sent upstream. They are likely to have their own comments, but knocking out the initial obvious things saves some time and effort there (I find it isn't necessarily the easiest mailing list to deal with).
This should be as if it is being submitted upstream, so |
6by9
left a comment
There was a problem hiding this comment.
DT bindings needs to come before the driver. MAINTAINERS normally gets updated once with the bindings to add both bindings and the driver files, eg torvalds/linux@8a97a46
By copying imx477 I'm afraid you've got caught in the cross-fire slightly between us and mainline over supporting multiple streams (ie image with embedded metadata). Mainline still haven't resolved this, although patches have been kicked around recently. We adopted just advertising 2 pads for the two streams, but that isn't be acceptable to upstream.
If you're looking to upstream this, then the references to METADATA_PAD need to be removed, and all the pad index checks become if (thing->pad) instead of if (things->pad >= NUM_PADS). I'm happy to accept an additional patch to our tree which adds the second pad back in, and proper support for the streams can be added when they've decided how to do it.
Add YAML device tree binding for IMX519 CMOS image sensor, and the relevant MAINTAINERS entries. Signed-off-by: Lee Jackson <info@arducam.com>
0002a4e to
81ba9dd
Compare
|
Hi 6by9 |
81ba9dd to
6b97de2
Compare
|
No problems. I'm happy to review drivers before submission upstream as I recognise that it is a fairly steep learning curve. My comment still applies over the METADATA_PAD - that isn't the way upstream are going to want it, so simplest to implement just exposing video initially. Add the metadata pad later on if we have code that will parse it. |
|
Yes, I saw your description of METADATA_PAD, I was thinking maybe we have a chance to merge it into the Raspberry Pi kernel first? |
Adds a driver for the 16MPix IMX519 CSI2 sensor. Whilst the sensor supports 2 or 4 CSI2 data lanes, this driver currently only supports 2 lanes. The following Bayer modes are currently available: 4656x3496 10-bit @ 10fps 3840x2160 10-bit (cropped) @ 21fps 2328x1748 10-bit (binned) @ 30fps 1920x1080 10-bit (cropped/binned) @ 60fps 1280x720 10-bit (cropped/binned) @ 120fps Signed-off-by: Lee Jackson <info@arducam.com>
|
Hi @6by9 |
|
Sorry, I'd missed your previous comment. We try to minimise any differences to mainline, unless a feature or change is totally unacceptable to mainline (eg the abuse of pads for the metadata stream). So it really would be preferable to have the METADATA_PAD change split out as a separate patch. You need to do that for mainline anyway. |
This commit updates the imx519 driver to adverise support for embedded data streams. The imx519 sensor subdevice overloads the media pad to differentiate between image stream (pad 0) and embedded data stream (pad 1) when performing the v4l2_subdev_pad_ops functions. Signed-off-by: Lee Jackson <info@arducam.com>
Include the driver module for the IMX519. Signed-off-by: Lee Jackson <info@arducam.com>
Added overlays for enabling IMX519 and add the relevant information to the README. Signed-off-by: Lee Jackson <info@arducam.com>
6b97de2 to
beab022
Compare
|
Hi @6by9 |
|
Hi @6by9 |
|
Apologies, I had missed the update again. That looks good now. There may be a couple of quibbles upstream over minor details of the implementation, but most of it looks fine to me. |
|
These patches required some adjustments for the newer kernels, but they're in rpi-5.14.y and rpi-5.15.y now (along with blank lines after the first lines of the commit messages). |
See: raspberrypi/linux#4571 kernel: rpi-5.10.y fixups See: raspberrypi/linux#4608 kernel: Add IMX519 driver and device tree overlay See: raspberrypi/linux#4548 kernel: dtoverlays: Add overlay for ST7735R (160x128) TinyDRM driver See: raspberrypi/linux#4615
See: raspberrypi/linux#4571 kernel: rpi-5.10.y fixups See: raspberrypi/linux#4608 kernel: Add IMX519 driver and device tree overlay See: raspberrypi/linux#4548 kernel: dtoverlays: Add overlay for ST7735R (160x128) TinyDRM driver See: raspberrypi/linux#4615
|
Hi @pelwell
Do I need to make any changes to this? |
|
You tell me - it all compiles, but is otherwise untested. |
|
Got it, I will test it on the new version of the kernel. |
|
Hi @pelwell |
|
Excellent. |


No description provided.